#include <Starter.hpp>
#include <Misc/Config.hpp>


/* Function prototype */
void printHelp();



int main(int argc, char** argv){

	/* Init config to handle parameter */
	Config config;
	config.parseArguments(argc,argv);

	if(config.isHelpFlag()){
		printHelp();
		return 0;
	}else{
		Starter starter;
		return starter.start(config);

	}

}

void printHelp(){

	std::cout << "NetCalc-Server" << std::endl;
	std::cout << "Usage: netcalc_server [args]" << std::endl;
	std::cout << "Options:" << std::endl;
	std::cout << " -h --help\t Prints this help message." << std::endl;
	std::cout << " -p PORT\t Specifies the used port." << std::endl;
	std::cout << " -c CONNECTIONS\t Specifies how many connections can be handled." << std::endl;
	std::cout << " -IPv6\t\t Activates IPv6 support (IPv4 is default)." << std::endl << std::endl;
}
